﻿namespace Specifications
{
    //[TestFixture]
    //public class The_user_settings
    //{
    //    #region Setup/Teardown

    //    [SetUp]
    //    public void given_a_context_of()
    //    {
    //        _storage = MockRepository.GenerateStub<ILocalStorage>();
    //        _settings = new UserSettings(_storage);
    //    }

    //    #endregion

    //    private ILocalStorage _storage;
    //    private UserSettings _settings;

    //    [Test]
    //    public void can_be_persisted()
    //    {
    //        _settings.Save();

    //        _storage.AssertWasCalled(x => x.Save(_settings, UserSettings.FileName));
    //    }

    //    [Test]
    //    public void can_be_retrieved()
    //    {
    //        var some_old_settings = new UserSettings(_storage);

    //        _storage.Stub(x => x.Load<UserSettings>(UserSettings.FileName))
    //            .Return(some_old_settings);

    //        var loaded = UserSettings.LoadFrom(_storage);

    //        Assert.That(loaded, Is.EqualTo(some_old_settings));
    //    }

    //    [Test]
    //    public void creates_a_new_instance_if_it_cannot_be_retrieved()
    //    {
    //        _storage.Stub(x => x.Load<UserSettings>(UserSettings.FileName))
    //            .Return(null);

    //        var loaded = UserSettings.LoadFrom(_storage);

    //        Assert.That(loaded, Is.Not.Null);
    //    }

    //    [Test]
    //    public void raises_change_notification()
    //    {
    //        _settings.AssertThatAllProperties()
    //            .RaiseChangeNotifcation();
    //    }
    //}
}